<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    //在js中只有关键字才可以上原型链; 方法是上不了原型链的
    var obj = {
        name:undefined
    }

    /*if("toString" in obj){
        console.log("有toString属性")
    }*/


    if(obj.hasOwnProperty("toString")){
        console.log("有toString属性")
    }
</script>
</html>